package com.api.entity;


import com.api.log.FieldAnnotation;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.activerecord.Model;

import java.util.Date;


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
* 消息通知 实体类。
*
* @author yangsf
* @since 2024-10-24
*/
@Accessors(chain = true)
@Data(staticConstructor = "create")
@EqualsAndHashCode(callSuper = true)
@Table("tb_mailbox")
public class Mailbox extends Model<Mailbox> {

private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Auto)
    @FieldAnnotation("id")
    private Long id;

    /**
    * 接收人
    */
    @FieldAnnotation("接收人")
    private Long userId;

    /**
    * 类型： 1.行政公告
    */
    @FieldAnnotation("类型： 1.行政公告")
    private Integer kind;

    /**
    * 关联ID
    */
    @FieldAnnotation("关联ID")
    private Long rellId;

    /**
    * 标题
    */
    @FieldAnnotation("标题")
    private String title;

    /**
    * 状态： 0.删除 1.未读 2.已读 
    */
    @FieldAnnotation("状态： 0.删除 1.未读 2.已读 ")
    private Integer status;

    /**
    * 接收时间
    */
    @Column(onInsertValue = "now()")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @FieldAnnotation("接收时间")
    private Date createTime;

    @Column(value = "未读邮件数量",ignore = true)
    private Long mailboxCount;

}
